<HTML><HEAD><TITLE>indomain(?Var)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(fd)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>indomain(?Var)</H1>
Instantiate Var to a value in its domain.


<DL>
<DT><EM>?Var</EM></DT>
<DD>An integer or a domain variable
</DD>
</DL>
<H2>Description</H2>
   This predicate instantiates the domain variable Var to a value from its
   domain.  Its starts with the smallest element in the domain and on
   backtracking successive elements are taken.  It is used mostly to find
   an instantiation of the variable which is consistent with the current
   set of constraints in labeling procedures.  If List is a list of all
   domain variables occurring in the program, the simplest labeling
   procedure is written as

<P>
<PRE>
        labeling([]).
        labeling([Var|Rest]) :-
            indomain(Var),
            labeling(Rest).
</PRE>

<H3>Fail Conditions</H3>
   None.


<H3>Resatisfiable</H3>
   Yes.
<H2>See Also</H2>
<A HREF="../../lib/fd/NN-2.html">:: / 2</A>, <A HREF="../../lib/fd/HNN-2.html">#:: / 2</A>, <A HREF="../../lib/fd/par_indomain-1.html">par_indomain / 1</A>, <A HREF="../../lib/fd/labeling-1.html">labeling / 1</A>, <A HREF="../../lib/fd_search/search-6.html">fd_search : search / 6</A>
</BODY></HTML>
